<?php

namespace App\Models;

class EwMemberSubs extends BaseModel
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $id;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=false)
     */
    public $member_id;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=false)
     */
    public $cate_id;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $region;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $area;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $layout;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $price;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $other;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $dics_ids;

    /**
     *
     * @var string
     * @Column(type="string", nullable=false)
     */
    public $create_time;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        parent::initialize();
        $this->belongsTo('member_id', 'App\Models\\EwMember', 'id', ['alias' => 'EwMember']);
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'ew_member_subs';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return EwMemberSubs[]|EwMemberSubs
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return EwMemberSubs
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
